package com.axjy.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class SystemExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public Result handleException(RuntimeException ex){
        log.error("全局异常捕获",ex);
        return Result.fail("查询数据不存在，请联系管理员！");
    }
}
